﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" 
    AutoEventWireup="true" CodeFile="Page_ContactAdmin.aspx.cs" Inherits="Admin_Page_ContactAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%">
        <tr>
            <td align="center">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                    BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                    DataKeyNames="Ma" DataSourceID="SqlDataSource2" Width="617px"
                    onrowdatabound="GridView1_RowDataBound" 
                    onselectedindexchanging="GridView1_SelectedIndexChanging" 
                    onsorting="GridView1_Sorting" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                    <RowStyle BackColor="White" ForeColor="#003399" />
                    <Columns>
                        <asp:TemplateField HeaderText="Thao tác">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/images/view_icon.png"
                                    NavigateUrl='<%# Eval("Ma","~/Admin/Page_ContactAdmin_View.aspx?Id={0}") %>'>HyperLink
                                </asp:HyperLink>
                                &nbsp;
                                <%--<asp:HyperLink ID="HyperLink2" runat="server" ImageUrl="~/images/delete-icon.png"
                                    NavigateUrl='<%# Eval("Ma","~/Admin/Page_ContactAdmin_View.aspx?Id={0}") %>'>HyperLink
                                </asp:HyperLink>--%>
                                <asp:ImageButton ID="cmd_DeleteButton" runat="server"  ImageUrl="~/images/delete-icon.png" 
                                    CommandArgument='<%# Eval("Ma") %>' OnClick="cmd_DeleteButton_Click"/>
                            </ItemTemplate>
                            <ItemStyle Width="50px" />
                        </asp:TemplateField>
                        
                        <asp:BoundField DataField="Ma" HeaderText="Mã" InsertVisible="False" Visible="False" 
                            ReadOnly="True" SortExpression="Ma">
                        <ItemStyle Width="30px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="TenKhachHang" HeaderText="Tên khách hàng" 
                            SortExpression="TenKhachHang">
                        <ItemStyle Width="100px" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="TieuDe" HeaderText="Tiêu đề" 
                            SortExpression="TieuDe">
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="ThoiDiem" HeaderText="Thời gian đăng" 
                            SortExpression="ThoiDiem" DataFormatString="{0:dd/MM/yyyy HH:mm}">
                        <ItemStyle Width="100px" />
                        </asp:BoundField>
                        
                    </Columns>
                    <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                    <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                    <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                    <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                </asp:GridView>
                
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:TramHuongDB2ConnectionString %>" 
                    SelectCommand="SELECT [Ma], [TenKhachHang], [TieuDe], [ThoiDiem] FROM [Contact] ">
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
    </table>
</asp:Content>
